package cn.semcorp.zhuhaizj.mapper;

import cn.semcorp.zhuhaizj.pojo.dto.*;
import cn.semcorp.zhuhaizj.pojo.entity.BatchTrainingEntity;
import cn.semcorp.zhuhaizj.pojo.entity.CommonEntity;
import cn.semcorp.zhuhaizj.pojo.entity.UpdateAbleByEntity;
import cn.semcorp.zhuhaizj.pojo.vo.*;
import cn.semcorp.zhuhaizj.restful.JsonPage;
import cn.semcorp.zhuhaizj.restful.JsonResult;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

@Repository
public interface TrainingMapper {
    int addRecords(List<InsertRecordDTO> list);
    int insertList(List<TrainingDataDTO> list);
    int insertListF(AddPeopleDTO addPeopleDTO);
    List<TrainingDataVO> selectTrainingClassList();

    /**
     * 修改课程
     * @param trainingDataDTO
     */
    int updateTraining(TrainingDataDTO trainingDataDTO);

    /**
     * 新增
     * @param trainingDataDTO
     */
    int add(TrainingDataDTO trainingDataDTO);

    /**
     * 初始化加载
     */
    List<FlowerUserDTO> selectFlowerList();
    List<FlowerUserDTO> selectFlowerListCondition(String result);
    List<FlowerUserDTO> selectFlowerListOther(String a , String b);
    List<FlowerUserDTO> selectFlowerListSp(String department);// 特殊方法

    /**
     * 根据id删除员工信息
     * @param id
     */
    int deleteById(int id);

    /**
     * 修改花名册人员信息
     * @param dto
     */
    int updatePeopleById(UpdatePeopleDTO dto);

    /**
     * 根据id查询人员信息
     * @param id
     */
    FlowerUserDTO selectFlowerUserById(String id);

    /**
     * 模糊查询
     * @param content
     */
    List<FlowerUserDTO> selectMH(String content);

    /**
     * 导入年度教育培训计划
     * @param list
     */
    int inputEducationPlan(List<TrainingInputEducationDTO> list);

    /**
     * 查询年度教育培训计划
     */
    List<TrainingInputEducationVO> selectEducationList();

    /**
     * 导入年度技能培训计划
     * @param list
     */
    int inputSkillPlan(List<TrainingInputSkillDTO> list);

    /**
     * 查询年度技能培训计划
     */
    List<TrainingInputSkillVO> selectSkillList();

    /**
     * 删除去年的年度教育计划
     */
    int deleteEducationPlan();

    int deleteSkillPlan();


    /**
     * 查询培训记录列表
     * @return
     */
    List<RecordDTO> selectTestRecordList();
    List<RecordDTO> selectTrainingRecordList();

    /**
     * 根据姓名查询所有培训记录
     * @return
     */
    List<RecordDTO> selectTestRecordByCondition(SelectTestRecordByNameDTO dto);
    List<RecordDTO> selectTrainingRecordByCondition(SelectTrainingRecordByNameDTO dto);

    /**
     * 查询当月待完成培训任务
     * @param month
     */
    List<TrainingInputSkillVO> skillPlanCheck(String month,String icon);
    List<TrainingInputEducationVO> educationPlanCheck(String month,String icon);

    /**
     * 生成技能/教育
     * @param trainingInputSkillVOS
     */
    int insertSkillPlan(List<TrainingInputSkillVO> trainingInputSkillVOS);
    int insertEducationPlan(List<TrainingInputEducationVO> list);

    /**
     * 查询技能认定月计划
     * @param
     */
    List<SelectSkillPlan> selectSkillPlanList();

    /**
     * 查询教育计划月计划
     * @param
     * @return
     */
    List<SelectEducationPlan> selectEducationPlanList();

    /**
     * 完成任务,  修改计划状态
     * @param id
     */
    int updateEducationPlanStateById(String id,String state);
    int updateSkillPlanStateById(String id,String state);

    /**
     * 计划任务 5分钟, 监控当月教育培训计划都是否完成
     */
    List<SelectEducationPlan> selectNowMonthEducationTobeCompleted(String yearMonth,String state);

    /**
     * 计划任务 5分钟, 监控当月技能认定计划都是否完成
     */
    List<SelectSkillPlan> selectNowMonthSkillTobeCompleted(String yearMonth,String state);

    /**
     * 修改教育计划进度表
     * @param
     * @param month
     * @param icon2
     */
    int updateEducationPlanCompleted(String month, String icon2,String id);
    int updateSkillPlanCompleted(String month, String icon2,String project);

    /**
     * 统计教育计划未完成数量
     * @param yearMonth
     * @param common2
     * @return
     */
    int countEducationPlanByMonth(String yearMonth, String common2);
    int countSkillPlanByMonth(String yearMonth, String common2);

    /**
     * 上传图片
     * @param outId
     * @param date
     * @param base64
     */
    int insertEducationPicture(String outId, String date, String base64);
    int insertSkillPicture(String outId, String date, String base64);

    List<String> queryEducationPictureById(String id);
    List<String> querySkillPictureById(String id);

    int updateEducationPlanCompletedBy(String month, String icon1, String icon3, String project);

    int deletePeopleById(String id);

    List<SelectSkillPlan> selectSkillPlanListInsert(String yearMonth);

    List<SelectEducationPlan> selectEducationPlanListInsert(String yearMonth);

    Integer queryEducationPictureCountById(String id);

    Integer querySkillPictureCountById(String id);

    CoursesVO selectCoursesByClassCode(String classCode);

    FlowerUserVO selectPeopleByName(String name);

    int batchTrainingInsert(List<BatchTrainingEntity> list);

    List<String> selectCodeList();

    int deleteTrainingById(String id);
    int deleteTestRecordById(String id);
    int deleteStudyRecordById(String id);

    List<String> selectClassModelList();

    List<String> selectClassCodeByClassModel(String classModel);

    TCVO selectTopicContentByClassCode(String classCode);

    int addTestPlan(List<StudyDTO> list);
    int addStudyPlan(List<StudyDTO> list);

    SelectFlowerByVO selectFlowerById(String id);

    int updateFlowerAgeLimit(int id, String ageLimit);

























    /**
     * 测试方式
     *
     *
     *
     *
     *
     *
     *
     *
     *
     * @param
     */
    void updateTest(Integer id,String time);
    //String result
    List<StudyVO> selectTestList(String result);
    List<StudyVO> selectTrainingList1(boolean result);

    int uploadStudyPlanById(String id, String base64);

    List<String> queryStudyPictureById(String id);

    int queryStudyPictureCountById(String id);

    int updateTestById(String id,String result,boolean isComplete);
    int updateTrainingById(String id,String result,boolean isComplete);

    void tobeUpdateFormalById(int id, String value);

    void deleteStudyById(Integer id);

    void deleteStudyPictureById(String id);

    String selectTrainingRecordByYes(String name,String able,String yes);
    String selectTrainingRecordByYes1(String name,String able,String result);
    String selectTrainingRecordByYes1Fu(String able,String result);
    String selectTrainingRecordByYes1FuFu(String able,String result,String workshop);
    String selectTrainingRecordByNo(String name,String able,String no);
    String selectTrainingRecordByIdAll(String name,String able);
    String selectTrainingRecordByIdAllS(String name,String able,String result);
    String selectTrainingRecordByIdAllSFu(String able,String result);
    String selectTrainingRecordByIdAllSFuFu(String able,String result,String workshop);



    String selectAbleAllSubject(String able);

    String selectAbleStudySubject(String name, String able);

    int addPromotionPlan(ArrayList<AddPromotionDTO> list);

    List<SelectPromotionVO> selectPromotionList();

    List<SelectPromotionVO> selectPromotionByDate(String date);

    String selectRecordLastDate();

    String countAuditPlan(String state);

    int updatePromotionStateSuccessById(String id);
    int updatePromotionStateNoById(String id);

    PassPromotionVO selectPromotionStateSuccessById(String id);

    void updatePeoplePromotion(PassPromotionVO passPromotionVO);

    void addPromotionPlanOne(AddPromotionDTO addPromotionDTO);

    StudyDTO selectTestListById(String id);
    StudyDTO selectTrainingListById(String id);

    void insertTestTrainingRecord(StudyDTO studyVO);
    void insertTrainingRecord(StudyDTO studyVO);

    int deleteStudyPlanById(String id);

    CommonEntity queryEducationPlanStateById(String id);

    CommonEntity querySkillPlanStateById(String id);

    void updateEducationPlanCompletedYqToYes(String month, String icon2, String project);

    void updateSkillPlanCompletedYqToYes(String month,String icon2, String project);

    List<String> selectFlowerListByWorkshop(String workshop);

    void selectEducationPersonUpById(String id,String name,String workshop);
    void selectSkillPersonUpById(String id,String name,String workshop);

    String selectEducationPlanById(String id);
    String selectEducationPlanById2(String id);

    List<String> selectFlowerListName();

    String selectSkillPlanById(String id);
    String selectSkillPlanById2(String id);

    List<String> selectPersonByWorkshopPostClass(String workshop, String post);


    List<String> selectAllAbleDistinct();

    List<String> selectFlowerByLevel(String level);

    void insertAssess(List<InsertAssessDTO> list);

    List<InsertAssessVO> selectSelect();

    void addAssess(InsertAssessDTO dto);

    List<String> selectDistinctViolateModel();

    String selectAssessByViolate(String violate,String name,String punish);
    String selectAssessByViolateFu(String violate,String workshop,String punish);
    String selectAssessByViolateFuFu(String violate,String punish);

    List<String> selectViolateList();

    void insertAssessModel(String model);


    /**
     * 内部接口
     * @param date
     */
    void insertTrainingDate(String date);
    void insertEducationModel(String educationModel);
    void insertTrainingModel(String trainingModel);
    void insertClassModel(String classModel);

    List<String> selectTrainingDate();
    List<String> selectEducationModel();
    List<String> selectClassModel();
    List<String> selectClassModelAble();
    List<String> selectTrainingModel();

    /**
     * 修改课程人入职时间格式
     * @param id
     * @param formatterLocalDate
     */
    void updateFlowerUserById(int id, String formatterLocalDate);

    SelectCountAssessVO selectCountAssess(String name);

    SelectCountClassVO selectCountClassByName(String name);

    SelectCountAssessAllVO selectAssessColumnByViolateOrPunish(String violate, String name);
    SelectCountAssessAllVO selectAssessColumnByViolateOrPunishFu(String violate, String workshop);
    SelectCountAssessAllVO selectAssessColumnByViolateOrPunishFuFu(String violate);

    SelectCountClassVO selectCountTrainingByName(String name);

    /**
     * 查询每一个车间的培考情况
     * @param workshop
     * @return
     */
    String selectCountTrainingByWorkshop(String workshop);

    List<SchemaVO> selectFlowerPostByWorkshopAndShift(String workshop, String shift, String post);
    List<SchemaVO> selectFlowerPostByWorkshopAndShift1(String workshop, String shift);

    List<String> selectPostClassALl();

    List<String> selectPostByPostClass(String postClass);

    List<String> selectPulpingWorkshop();
    List<String> selectPulpingWorkshopCommon();
    List<String> selectPulpingWorkshopFu();

    List<String> selectNameByWorkshop(String workshop);

    PromotionUpVO selectNullPromotionUpByPost(String post);

    void deletePromotionById(String id);

    boolean selectFlowerListNameByOperator(String icon);
    boolean selectFlowerListNameByMain(String icon);
    boolean selectFlowerListNameByMonitor(String icon);

    List<String> selectFlowerListByPostClass(String postClass,String workshop);

    int countStudy(String result);

    String selectInformationAll(String resultYes);

    String selectInformationByAble(String result, String resultYes,String able);

    String countPeople();

    String selectInformationByAbles(String result, String resultYes, String able);
    String selectInformationByAblesFu(String result, String resultYes, String able,String workshop);

    String selectInformationByAbless(String result, String common5, String able);
    String selectInformationByAblessFu(String result, String common5, String able,String workshop);

    List<String> selectAssessModelByTrainingModel(String training);

    SelectResultVO selectResultByAssess(String assess, String name);
    SelectResultVO selectResultByAssessFu(String assess);
    SelectResultVO selectResultByAssessFuFu(String assess,String workshop);

    void updateCompetencyAssessment(Integer id, String able);

    String selectStudyListCount(String result);

    void deletePerformanceById(String id);

    String selectMaxCodeByModel(String model);

    List<NewPlanVO> selectNewPlan(String id);
    List<NewPersonPlanVO> selectNewPlanRecords();
    void insetNewPersonPlans(List<NewPersonPlanVO> list);

    void updateNewPersonPlanOverById(String id);

    void updateNewFlowerPlan(int id,String plan);

    void submitInsertPersonPlan(List<SubmitPersonPlanDTO> list);

    List<SubmitPersonPlanVO> selectPersonalPlanById(String id,String result);

    void submitUpdatePersonPlan(String id,boolean yes,String result);

    void deleteTestIngRecordById(String id);

    void deleteStudyIngPlanById(String id);

    void submitDeletePersonPlan(String id);

    List<StudyVO> queryTestList(QueryTestDTO dto);

    List<StudyVO> queryStudyList(QueryStudyDTO dto);

    List<InsertAssessVO> queryPerformanceList(QueryPerformanceDTO dto);

    List<TrainingDataVO> querySubjectList(QuerySubjectDTO dto);

    void deleteTestById(Integer id);
}
